package com.ssy.jt808.gateway.sdk.terminal.message.connection;

import com.ssy.jt808.gateway.sdk.terminal.constant.ConnectionStatusEnum;
import com.ssy.jt808.gateway.sdk.terminal.message.TerminalMessageBase;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author wangzezhou
 */
@Data
public class TerminalOnlineMessage extends TerminalMessageBase<ConnectionStatusEnum>{

  /** 网关节点 IP */
  private String host;

  private LocalDateTime time;

  public TerminalOnlineMessage(){
    this.time = LocalDateTime.now();
  }

  public TerminalOnlineMessage( String host ){
    this();
    this.host = host;
  }

  /** 消息类型 */
  @Override
  public ConnectionStatusEnum type(){
    return ConnectionStatusEnum.Online;
  }
}
